package com.smartlib.cmnObject.dialog;

import android.app.Dialog;
import android.app.DialogFragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;

import com.smartlib.cmnObject.R;

/**
 * loadding dialog
 * Created by admin on 16/6/7.
 */
public class LoaddingDialogFragment extends DialogFragment {
    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        Dialog dialog = new Dialog(getActivity(), R.style.customdialog);
        LayoutInflater inflater = getActivity().getLayoutInflater();
        View view = inflater.inflate(R.layout.dialog_loading_withoutmsg, null);
        ImageView spaceshipImage = (ImageView) view.findViewById(R.id.dialog_loading_withoutmsg_image);
        // 加载动画
        Animation hyperspaceJumpAnimation = AnimationUtils.loadAnimation(
                getActivity(), R.anim.rotate);
        spaceshipImage.startAnimation(hyperspaceJumpAnimation);
        dialog.setContentView(view);
        return dialog;
    }
}
